package com.laizhenghua.configClient.controller;

import com.laizhenghua.commons.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: ConfigController
 * @date: 2022/2/20 19:58
 */
@Slf4j
@RefreshScope
@RestController
@RequestMapping(path = "/config")
public class ConfigController {
    @Value(value = "${config.info}")
    private String configInfo;

    @RequestMapping(path = "/getConfigInfo", method = RequestMethod.GET)
    public R getConfigInfo() {
        return R.ok().put("data", configInfo);
    }
}
